const app = getApp();

const Request = (options) => {
  console.log("请求参数：",options);
  return new Promise((resolve,reject) => {
    wx.request({
      url: options.url || '',
      data: options.data || {},
      method: options.method || 'POST',
      header: {'content-type': "application/x-www-form-urlencoded"},
      responseType: options.responseType || "",
      timeout: 15000,
      success: (res) => {
        console.log("请求成功回调：",res);
      },
      fail: (error) => {
        console.log("请求失败回调：",error);
      }
    })
  })
}

module.exports = {
  Request
}